package com.etooling.framework.entity;


import com.etooling.framework.svo.AbstractEntity;
import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.*;
import java.util.Date;

/**
 * 附件
 */
@Entity
@Table(name = "t_attach_file", schema = "framework")
public class AttachFile extends AbstractEntity {

    private String name;//文件名称
    private String description;//描述
    private String filePath;//文件路径
    private Long fileSize;//文件大小
    private String webPath;//直接访问路径
    private String fileType;//文件类型,文件的后缀
    private Date createTime;//上传时间
    private Boolean encrypt;//是否需求加密
    @JsonIgnore
    private transient FileResource fileResource;//数据源

    public Boolean getEncrypt() {
        return encrypt;
    }

    public void setEncrypt(Boolean encrypt) {
        this.encrypt = encrypt;
    }

    public String getFileType() {
        return fileType;
    }

    public void setFileType(String fileType) {
        this.fileType = fileType;
    }

    @ManyToOne(targetEntity = FileResource.class, fetch = FetchType.EAGER)
    @JoinColumn(name = "file_resource")
    public FileResource getFileResource() {
        return fileResource;
    }

    public void setFileResource(FileResource fileResource) {
        this.fileResource = fileResource;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public Long getFileSize() {
        return fileSize;
    }

    public void setFileSize(Long fileSize) {
        this.fileSize = fileSize;
    }

    public String getWebPath() {
        return webPath;
    }

    public void setWebPath(String webPath) {
        this.webPath = webPath;
    }

}